%%%-------------------------------------------------------------------
%%% File    : util.hrl
%%% Author  :  <vjache>
%%% Description : 
%%%
%%% Created : 18 Jan 2009 by  <vjache>
%%%-------------------------------------------------------------------
-define(PPG_SPAWN_DISABLE, put(worker_ppg_spawn_disabled,true)).
-define(IS_PPG_SPAWN_DISABLED, case get(worker_ppg_spawn_disabled) of
					   undefined -> false;
					   false -> false;
					   _ -> true
					end).
-define(ASSERT_ROOT, put(prc_root_flag,true)).
-define(AM_I_ROOT, case get(prc_root_flag) of
					   undefined -> false;
					   false -> false;
					   _ -> true
					end).
-define(SET_PRC_NAME(Name), put(prc_name,Name)).
-define(PRC_NAME, get(prc_name)).

-define(REP_ERR(Report),error_logger:error_report(Report)).
-define(REP_CATCHED_ERR(Error,Format,Params),
		error_logger:error_report([{error,Error},
								   {message,lists:flatten(io_lib:format(Format, Params))},
								   {at,erlang:get_stacktrace()}])).
-define(REP_WARN(Report),error_logger:warning_report(Report)).
-define(REP_INFO(Report),error_logger:info_report(Report)).

-define(LOG_ERR(Format,Params), error_logger:error_msg(Format++"~n", Params)).
-define(LOG_INFO(Format,Params), error_logger:info_msg(Format++"~n", Params)).
-define(LOG_WARN(Format,Params), error_logger:warning_msg(Format++"~n", Params)).
-define(LOG_TRACE(Format,Params),ok).
%% 		io:format("PID~p [~p]:"++Format++"~n", [self(),?PRC_NAME|Params])). 

